namespace?=bi-service
export

.PHONY: install_mysql delete_mysql

install_mysql:
	-kubectl create ns ${namespace}
	kubectl apply -f bi-mysql.yaml -n ${namespace}

delete_mysql:
	kubectl delete -f bi-mysql.yaml -n ${namespace}

install_mysql_slave:
	kubectl apply -f bi-mysql-slave.yaml -n ${namespace}

delete_mysql_slave:
	kubectl delete -f bi-mysql-slave.yaml -n ${namespace}

# CREATE USER 'exporter'@'%' identified by 'exporter';
# GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'%';
# GRANT SELECT ON mysql.* TO 'exporter'@'%';

install_mysql_exporter:
	kubectl apply -f mysql-exporter.yaml -n ${namespace}

delete_mysql_exporter:
	kubectl delete -f mysql-exporter.yaml -n ${namespace}
